layui.define(['table', 'form','my_send'], function(exports){
    var $ = layui.$
    ,table = layui.table
    ,form = layui.form
    , http_proxy = layui.http_proxy;
    //综合列表
    table.render({
        elem: '#information'
        ,url: http_proxy('/monitor/getServerResourceByParams?mode=all') //模拟
        ,response: {
            statusName: 'code' //规定数据状态的字段名称，默认：code
            ,statusCode: 'success' //规定成功的状态码，默认：0
        } 
          ,parseData:function(res){
            var result=[];
            $.each(res.data,function (item, value) {
              value.value.name = value.name
              result.push(value.value);
            })
            return{
              "code":'success'
              ,"count":res.total
              ,"data":result
              ,'message':''
            }
          }
        ,cols: [[
            {field: "name",align: 'center', title: '服务器'}
            ,{field: 'resultCpuLoad',align: 'center',title:'CPU'}
            ,{field: 'resultDiskUsage',align: 'center', title: '磁盘'}
            ,{field: 'resultTemperature',align: 'center', title: '温度'}
            ,{field: 'resultMemoryUsage', align: 'center',title: '内存 '}
        ]]
        ,page: true
        ,limit: 10
        ,limits: [10, 15, 20, 25, 30]
        ,text: '暂无数据'
    });
    exports('information', {})
});